﻿<ds:SlView x:Class="SmartSpace.UI.Silverlight.Themes.ScienceFiction.NavigatePanel"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
    xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit"
    xmlns:ds="clr-namespace:SmartSpace.UI.Silverlight;assembly=SmartSpace.UI.Silverlight"
    mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">
    
    <ds:SlView.Resources>
        <BitmapImage x:Key="IBNavigationCollapsed" UriSource="/SmartSpace.UI.Silverlight.Themes.ScienceFiction;component/Resources/arrow_left.png" />
        <BitmapImage x:Key="IBNavigationExpanded" UriSource="/SmartSpace.UI.Silverlight.Themes.ScienceFiction;component/Resources/arrow_right.png" />

        <Style x:Key="LabelStyle1" TargetType="sdk:Label">
            <Setter Property="IsTabStop" Value="False"/>
            <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
            <Setter Property="VerticalContentAlignment" Value="Stretch"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="sdk:Label">
                        <Grid>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal">
                                    </VisualState>
                                    <VisualState x:Name="Disabled"/>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="ValidationStates">
                                    <VisualState x:Name="Valid"/>
                                    <VisualState x:Name="Invalid">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Duration="0:0:1.5" Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentControl">
                                                <DiscreteObjectKeyFrame KeyTime="0">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <SolidColorBrush Color="Red"/>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="RequiredStates">
                                    <VisualState x:Name="NotRequired"/>
                                    <VisualState x:Name="Required">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="FontWeight" Storyboard.TargetName="ContentControl">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="SemiBold"/>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="ExpansionStates">
                                    <VisualStateGroup.Transitions>
                                        <VisualTransition GeneratedDuration="0"/>
                                    </VisualStateGroup.Transitions>
                                    <VisualState x:Name="Collapsed">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="borderCollapsed">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="borderExpanded">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                                            </ObjectAnimationUsingKeyFrames>
                                            <!--<ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="(UIElement.Width)" Storyboard.TargetName="borderCollapsed">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="20"/>
                                            </ObjectAnimationUsingKeyFrames>-->
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Expanded">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="borderCollapsed">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="borderExpanded">
                                                <DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Border Name="borderExpanded" MinWidth="150" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="0" Padding="{TemplateBinding Padding}">
                                <ContentControl x:Name="ContentControl" Cursor="{TemplateBinding Cursor}" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}" FontWeight="{TemplateBinding FontWeight}" FontStretch="{TemplateBinding FontStretch}" FontSize="{TemplateBinding FontSize}" FontFamily="{TemplateBinding FontFamily}" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" IsTabStop="False" VerticalAlignment="{TemplateBinding VerticalAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
                            </Border>
                            <Border Name="borderCollapsed" Visibility="Collapsed" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="0" Padding="0">
                                <Button Margin="0" Padding="0" Width="25" Click="OnButtonExpandedClick" BorderThickness="0" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch">
                                    <Grid>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="auto"/>
                                            <RowDefinition Height="*"/>
                                        </Grid.RowDefinitions>
                                        <Image Margin="0,3,0,0" Source="{StaticResource IBNavigationExpanded}" HorizontalAlignment="Center" Grid.Row="0" Stretch="None"/>
                                        <TextBlock Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="15" Text="{TemplateBinding Tag}" TextWrapping="Wrap"/>
                                    </Grid>
                                </Button>
                            </Border>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </ds:SlView.Resources>
    <sdk:Label Name="borderLabel" Style="{StaticResource LabelStyle1}" BorderBrush="#FF6593cf" BorderThickness="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
        <Grid x:Name="LayoutRoot" Background="#55ffffff">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <Border Grid.Row="0" BorderBrush="#FF6593cf" BorderThickness="0,0,0,1">
                <Border BorderBrush="White" BorderThickness="1,1,0,0">
                    <ds:SlHeader Grid.Column="0" Padding="5,0,5,0" HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="auto"/>
                            </Grid.ColumnDefinitions>
                            <ds:SlHeader Grid.Column="0" x:Name="m_headerTitle">
                                <ds:SlHeader.Content>
                                    <TextBlock Text="导航列表" FontSize="14" VerticalAlignment="Center" Margin="5,0,0,0"/>
                                </ds:SlHeader.Content>
                            </ds:SlHeader>
                            <Button Grid.Column="1" Name="m_buttonCollapse" Margin="3,3,0,3" Padding="1" Click="OnButtonCollapseClick">
                                <Image Source="{StaticResource IBNavigationCollapsed}" Stretch="None"/>
                            </Button>
                        </Grid>
                    </ds:SlHeader>
                </Border>
            </Border>
            <!--<Border Name="m_borderNavigationContainer"  Grid.Row="1" Background="White">
                <sdk:TreeView Name="m_treeNaigations" BorderThickness="0" SelectedItemChanged="OnTreeNaigationsSelectedItemChanged" ItemContainerStyle="{StaticResource ExpandedTreeItem}">
                    <sdk:TreeView.ItemTemplate>
                        <sdk:HierarchicalDataTemplate ItemsSource="{Binding Children}">
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="{Binding Name}"/>
                            </StackPanel>
                        </sdk:HierarchicalDataTemplate>
                    </sdk:TreeView.ItemTemplate>
                </sdk:TreeView>
            </Border>-->
            <Border Grid.Row="1" BorderThickness="0">
                <toolkit:Accordion Name="m_accordionNavigations" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" MinHeight="20" Margin="0" Padding="0" BorderThickness="0" SelectionChanged="m_accordionNavigations_SelectionChanged">
                    <toolkit:Accordion.ItemTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Name}" FontSize="13.5" Margin="5,0,0,0" VerticalAlignment="Center" FontWeight="Bold">
                            <TextBlock.Foreground>
                                <LinearGradientBrush>
                                    <GradientStop Color="#184785" Offset="0.0" />
                                </LinearGradientBrush>
                            </TextBlock.Foreground>
                            </TextBlock>
                        </DataTemplate>
                    </toolkit:Accordion.ItemTemplate>
                    <toolkit:Accordion.ContentTemplate>
                        <DataTemplate x:Name="m_accordionContentTemplate">
                            <sdk:TreeView VerticalAlignment="Stretch" VerticalContentAlignment="Stretch" ItemsSource="{Binding Children}" SelectedItemChanged="OnTreeNaigationsSelectedItemChanged"  Foreground="DarkSlateBlue">
                                <sdk:TreeView.ItemTemplate>
                                    <sdk:HierarchicalDataTemplate ItemsSource="{Binding Children}">
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Text="{Binding Name}">
                                            <TextBlock.Foreground>
                                                <LinearGradientBrush>
                                                    <GradientStop Color="#184785" Offset="0.0" />
                                                </LinearGradientBrush>
                                            </TextBlock.Foreground>
                                            </TextBlock>
                                        </StackPanel>
                                    </sdk:HierarchicalDataTemplate>
                                </sdk:TreeView.ItemTemplate>
                            </sdk:TreeView>
                        </DataTemplate>
                    </toolkit:Accordion.ContentTemplate>
                </toolkit:Accordion>
            </Border>
        </Grid>
    </sdk:Label>
</ds:SlView>
